package com.fjec.market.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.fjec.market.service.IInfoPersonalService;

import javax.annotation.Resource;

/**
 * <p>
 * 049.个人用户表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-09-24
 */
@RestController
@RequestMapping("/")
public class InfoPersonalController {

    @Resource
    private IInfoPersonalService service;

    @PostMapping("/personal/save")
    public boolean save(@RequestParam Long userId,
                        @RequestParam(required = false) Long coopId,
                        @RequestParam(required = false) String nickName,
                        @RequestParam(required = false) String headPic) {
        return service.save(userId, coopId, nickName, headPic);
    }

    /**
     * 更新人员
     * @param userId
     * @param nickName
     * @param headPic
     * @return
     */
    @PostMapping("/personal/update")
    public boolean update(@RequestParam Long userId,
                          @RequestParam(required = false) String nickName,
                          @RequestParam(required = false) String headPic) {
        return service.updateNickNameAndHeadPicByUserId(userId, nickName, headPic);
    }
}
